<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRechargePackageTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recharge_package', function (Blueprint $table) {
            $table->increments('id');
            $table->string("name",50)->default('')->comment("名称");
            $table->tinyInteger("discount")->default(100)->comment("折扣");
            $table->integer("min_money")->default(0)->comment("最小充值金额（分）");
            $table->integer("max_money")->default(0)->comment("最大充值金额（分）");
            $table->tinyInteger("months")->default(0)->comment("充值月份");
            $table->tinyInteger("is_selected")->default(0)->comment("是否默认 0 否 1是");
            $table->tinyInteger("is_first")->default(0)->comment("是否新人专享 0否 1是");
            $table->mediumInteger("sales")->default(0)->comment("实际销量");
            $table->mediumInteger("virtual_sales")->default(0)->comment("虚拟销量");
            $table->string("img_url",150)->default('')->comment("套餐图片");
            $table->tinyInteger("type")->default(0)->comment("类型 1 油卡充值 2 话费充值");
            $table->tinyInteger("is_deleted")->default(0)->comment("是否删除 0否 1是");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recharge_package');
    }
}
